<template>
  <el-form label-width="120px">


    <el-form-item>
      <el-button :loading="loading" type="primary" @click.native.prevent="submit" v-permission="['parameter.edit']">修改</el-button>
    </el-form-item>
  </el-form>
</template>

<script>
import { update } from '@/api/sysSetUp'
import singleUpload from '@/components/Upload/singleUpload'
import permission from '@/directive/permission/index.js' // 权限判断指令
export default {
  components: { singleUpload },
  directives: { permission },
  props: ['user'],
  data() {
    return {
      loading: false // 按钮防双击
    }
  },
  methods: {
    submit() {
      this.loading = true
      update(this.user).then(res => {
        console.log(res)
        this.loading = false
        this.$message.success('修改成功')
      }).catch(err => {
        console.log(res)
      })
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
